package com.aaron.test;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;

import java.util.Arrays;

/**
 * @author liurong
 * @date 2021/8/24 19:26
 * @version:
 */
public class T3 {

    private static void handlerParameter(JSONObject dataObject, JSONObject result, String parameterList) {
        try {
            JSONObject jsonObject = JSONObject.parseObject(parameterList);
            if (jsonObject != null) {
                for (String param : jsonObject.keySet()) {
//                    JSONObject privateObject = new JSONObject(result);
                    String[] parameter = jsonObject.getString(param).split("\\.");
                    if (parameter.length != 1) {
                        for (int i = 1; i < parameter.length; i++) {
                            try {
//                                privateObject = privateObject.getJSONObject(parameter[i - 1]);
                            } catch (Exception e) {
//                                privateObject = privateObject.getJSONArray(parameter[i - 1]).getJSONObject(0);
                            }
                        }
                    }
//                    if (StringUtils.isNotBlank(privateObject.getString(parameter[parameter.length - 1]))) {
//                        dataObject.put(param, privateObject.getString(parameter[parameter.length - 1]));
//                    } else {
//                        dataObject.put(param, "null");
//                    }
                }
            }
        } catch (NullPointerException e) {
        }
    }

    public static void main(String[] args) {
//        handlerParameter(null,null,"{\"charge\":\"charge\",\"smoke\":\"smoke\"}");
        String[] split = "xxx".split("\\.");
        for (String s : split) {
            System.out.println(s);
        }

    }

}

